#ifndef NANE_ZIPFILEARCHIVE_H
#   define  NANE_ZIPFILEARCHIVE_H

#   include "nane/FileArchiveSystem/IFileArchiveSystem.h"
#   include "nane/core/crt/FileSystem.h"

#   include <map>
#   include <string>

namespace nane
{
    struct ZIPFileInfo
    {
        bool compressed;
        uint32 beginPos;
        uint32 size;
        uint32 uncompressedSize;
    };
    
    class ZIPFileDeflated;
    class ZIPFileUncompressed;
    
    class ZIPFileArchive
        : public IFileArchive
    {
    public:
        ZIPFileArchive();
        ~ZIPFileArchive();
        
        bool Initialize( const InputSeekablePtr& _input );
        void Shutdown();
        
    public:
        IReadFile* OpenFile( const char* _filename );
        
        void Release( ZIPFileDeflated* _zipFileDeflated );
        void Release( ZIPFileUncompressed* _zipFileUncompressed );
        
    private:
        typedef std::map<std::string, ZIPFileInfo> TZIPMap;
        TZIPMap m_zipMap;
        InputSeekablePtr m_input;
    };
}   // namespace nane

#endif  // NANE_ZIPFILEARCHIVE_H
